﻿using iTextSharp.text;
using iTextSharp.text.pdf;
using iTextSharp.text.pdf.qrcode;
using Nop.Core.Domain.Media;
using System;
using System.Collections;
using System.Collections.Generic;

namespace Nop.Services.Media
{
    public class CodePictureService : ICodePictureService
    {
        private IPictureService _pictureService;

        public CodePictureService(IPictureService pictureService)
        {
            this._pictureService = pictureService;
        }

        public Picture QrCodeEncode(string contents, int width, int height)
        {
            var img = QrCodeEncodeToImage(contents, width, height);
            return null;
        }

        public string QrCodeDecode(Picture picture)
        {
            throw new NotImplementedException();
        }

        public Image QrCodeEncodeToImage(string contents, IDictionary<EncodeHintType, object> hints, int width = 1, int height = 1)
        {
            return new BarcodeQRCode(contents, width, height, hints).GetImage();
        }

        public Image QrCodeEncodeToImage(string contents, int width = 1, int height = 1)
        {
            return QrCodeEncodeToImage(contents, null, width, height);
        }
    }
}
